package com.example.minaim;



import java.util.List;

import android.content.Context;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

/**
 * @author <a href="http://bbs.droidstouch.com">Touch Android</a>
 *
 */
public class skillAdapter extends BaseAdapter
{

	
	private List<Skill> status;
	private Context context;
	private User userInfo;
	
	public skillAdapter(Context context,List<Skill> status,User userinfoUser) 
	{
		
		this.status = status;
		this.context = context;
		this.userInfo = userinfoUser;
	}
	
	
	public int getCount()
	{
		return status==null?0:status.size();
	}

	public Object getItem(int position)
	{
		return  status==null?null:status.get(position);
	}

	public String getName(int position)
	{
		return status.get(position).get_name();
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent)
	{
		
		
		View view = convertView;
		
		
		if(null == view)
		{
			
			skillHolder holder = new skillHolder();
			
			Skill s = this.status.get(position);
			
			view  = LayoutInflater.from(context).inflate(R.layout.skill_item_template, null);
			//holder.img_item_head = (ImageView) view.findViewById(R.id.img_Skill_head);
			holder.txt_name = (TextView) view.findViewById(R.id.txt_Skill_name);
			
			holder.txt_name.setText(s.get_name());		
		}
		
		return view;
	}

	
	private static class skillHolder
	{
		
		ImageView img_item_head;
		
		TextView txt_name;
				
	}


	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}	
	
}
